﻿using System;
using System.Collections.Generic;
using System.Text;

namespace KnBinarySerializer.Brick
{
    internal class FloatFormatter : IFormatter
    {
        public Type GetHandleType()
        {
            return typeof(float);
        }

        public byte GetKey()
        {
            return (byte)17;
        }
        public bool IsFixLen()
        {
            return true;
        }
        public object ReadBytes(BinarySerializeManager content, int maxLen, Type type)
        {
            return content.ReadFloat();
        }

        public int WriteBytes(BinarySerializeManager serial, object obj)
        {
            return serial.Write((float)obj);
        }
    }
}
